🚀 GALLIUMHASH AUTOMATION - LATEST COMPLETE FIX
==============================================

📋 UPLOAD INSTRUCTIONS - READ THIS FIRST!

STEP 1: Upload .env file (CRITICAL!)
------------------------------------
📄 .env (rename from GALLIUMHASH_ENV_FILE.env if needed)
→ Upload to: /home/nvdaxcom/public_html/.env (HOSTING ROOT LEVEL)

STEP 2: Upload Automation Scripts
----------------------------------
All .php files below go to: /home/nvdaxcom/public_html/core.galliumhash.com/automation/

📁 AUTOMATION FILES:
├── master-scheduler.php          ← MAIN AUTOMATION COORDINATOR
├── metabuilder-collector.php     ← Bitcoin data collection
├── metaminer-processor.php       ← Bitcoin intelligence
├── ethereum-gas-collector.php    ← Ethereum gas collection
├── system-health.php             ← Health monitoring dashboard
├── test-complete-system.php      ← System testing
├── cron-verification.php         ← Setup verification
└── CRON_SETUP.md                 ← Documentation

STEP 3: Set Cron Job in cPanel
------------------------------
1. Go to cPanel → Advanced → Cron Jobs
2. Click "Add New Cron Job"
3. Settings:
   - Common Settings: Custom
   - Minute: */5
   - Hour: *
   - Day: *
   - Month: *
   - Weekday: *
4. Command:
   /usr/local/bin/ea-php81 /home/nvdaxcom/public_html/core.galliumhash.com/automation/master-scheduler.php run

STEP 4: Test Everything
-----------------------
1. Visit: http://core.galliumhash.com/automation/cron-verification.php
   → This tests your setup and shows what works/needs fixing

2. After 5 minutes, visit: http://core.galliumhash.com/automation/system-health.php
   → This shows real-time status of all systems

STEP 5: Monitor
---------------
- Health Dashboard: http://core.galliumhash.com/automation/system-health.php
- Log Files: /home/nvdaxcom/public_html/core.galliumhash.com/automation/logs/
- Database: Check for fresh data entries with recent timestamps

WHAT THIS FIXES:
----------------
✅ Secures all hardcoded credentials with .env file
✅ Automates MetaBuilder (Bitcoin data collection)
✅ Automates MetaMiner (Bitcoin intelligence processing)
✅ Automates Ethereum Gas Collector
✅ Coordinates all systems via master scheduler
✅ Handles cPanel hosting constraints
✅ Includes comprehensive error handling
✅ Provides real-time monitoring

HOSTING COMPATIBILITY:
----------------------
✅ PHP 8.1 (ea-php81) - matches your core.galliumhash.com domain
✅ 5-minute cron optimization for better monitoring
✅ cPanel shared hosting resource limits respected
✅ Built-in timeout protection and retry logic

CRITICAL SUCCESS INDICATORS:
----------------------------
1. cron-verification.php shows all green checks
2. system-health.php shows "HEALTHY" status
3. Fresh data appearing in your databases
4. Log files being created in logs/ directory

TROUBLESHOOTING:
----------------
If issues occur, check:
1. PHP version in cPanel matches ea-php81
2. File permissions (644 for .php, 755 for .env)
3. .env file location is hosting root, not automation folder
4. Database credentials are correct

Your Bitcoin planet will no longer crash and everything will run automatically!